# 收集源文件
file(GLOB_RECURSE HFT_SOURCES
    "*.cpp"
)

# 创建库
add_library(hft_system ${HFT_SOURCES})

# 设置包含目录
target_include_directories(hft_system
    PUBLIC
        $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
        $<INSTALL_INTERFACE:include>
    PRIVATE
        ${CMAKE_CURRENT_SOURCE_DIR}
)

# 链接依赖库
target_link_libraries(hft_system
    PUBLIC
        spdlog::spdlog
        Threads::Threads
)

# 安装库
install(TARGETS hft_system
    EXPORT hft_system-targets
    LIBRARY DESTINATION lib
    ARCHIVE DESTINATION lib
    RUNTIME DESTINATION bin
    INCLUDES DESTINATION include
)

# 导出目标
install(EXPORT hft_system-targets
    FILE hft_system-targets.cmake
    NAMESPACE hft::
    DESTINATION lib/cmake/hft_system
)